﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CCalc__
{
    public class Cadbury
    {
        public void EasterMenu()
        {
            Console.Clear();
            Console.WriteLine("{|+|====|+|}[CCalc++ Ver: 0.1 -- Easter Eggs]{|+|====|+|}\n\n1.) Guess Again [1 - 100 guessing game]\n311.) Radio Hijynx");
            Console.Write("\nWhat would you like to see: ");
            Program MainMenu = new Program();
            string menuOption = Console.ReadLine(); //Gathers user input
            double mOnum; //Creates a variable for input storage to a double
            double.TryParse(menuOption, out mOnum); //Converts a string to the mentiond double
            if(mOnum == 311)
            {
                Console.WriteLine("\n311 X-Ray, 10-4 its a couch I'll be 98\n");
                Console.WriteLine("\nWhat would you like to do? \n\n1.) \tGoto: Main Menu \n2.) \tGoto: Easter Egg Menu\nEnter.) Exits the program\n");
                Console.Write("Please pick an option: ");
                string exitOtpIn = Console.ReadLine();
                double exitOptOut;
                double.TryParse(exitOtpIn, out exitOptOut);
                if (exitOptOut == 1)
                {
                    Console.WriteLine("\nGoing to Main Menu");
                    System.Threading.Thread.Sleep(500);
                    Console.Clear();
                    MainMenu.menuMain();
                }
                if (exitOptOut == 2)
                {
                    Console.WriteLine("\nBack to the Bunny Cave");
                    EasterMenu();
                    System.Threading.Thread.Sleep(500);
                }
            }
            if (mOnum == 1)
            {
                Random r = new Random();

                int val = r.Next(1, 100);
                int guess = 0;
                bool correct = false;
                Console.Clear();
                Console.WriteLine("{|+|====|+|}[CCalc++ Ver: 0.1 -- Guess Again]{|+|====|+|}\n");
                Console.WriteLine("I'm thinking of a number between 1 and 100.");

                while (!correct)
                {
                    Console.Write("Guess: ");
                    string input = Console.ReadLine();

                    if (!int.TryParse(input, out guess))
                    {
                        Console.WriteLine("That's not a number.");
                        continue;
                    }

                    if (guess < val)
                    {
                        Console.WriteLine("No, the number I'm thinking is higher than that number.");
                    }
                    else if (guess > val)
                    {
                        Console.WriteLine("No, the number I'm thinking is lower than that number.");
                    }
                    else
                    {
                        correct = true;
                        Console.WriteLine("\n\nYOU GUESSED RIGHT!!");
                    }
                }

                Console.WriteLine("\nWhat would you like to do? \n\n1.) \tGoto: Main Menu \n2.) \tGoto: Easter Egg Menu\nEnter.) Exits the program\n");
                Console.Write("Please pick an option: ");
                string exitOtpIn = Console.ReadLine();
                double exitOptOut;
                double.TryParse(exitOtpIn, out exitOptOut);
                if (exitOptOut == 1)
                {
                    Console.WriteLine("\nGoing to Main Menu");
                    System.Threading.Thread.Sleep(500);
                    Console.Clear();
                    MainMenu.menuMain();
                }
                if (exitOptOut == 2)
                {
                    Console.WriteLine("\nBack to the Bunny Cave");
                    EasterMenu();
                    System.Threading.Thread.Sleep(500);
                }
            }

        }
    }
}